package com.adee.gulimall.ware.feign;

import com.adee.gulimall.util.utils.R;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

@FeignClient("gulimall-gateway")
public interface ProductFeignService {
    /**
     * sku信息
     * 两种写法：
     * 1. 直接给gulimall-product微服务发请求
     * @FeignClient("gulimall-product")，/product/skuinfo/info/{skuId}
     * 2.经过gateway，再给gulimall-product微服务发请求
     * @FeignClient("gulimall-gateway")，/api/product/skuinfo/info/{skuId}
     */
    @RequestMapping("/api/product/skuinfo/info/{skuId}")
    R info(@PathVariable("skuId") Long skuId);
}
